\(\int \frac {\cos ^3(c+d x) \cot (c+d x)}{a+a \sin (c+d x)} \, dx\) [413]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 27, antiderivative size = 59 \[ \int \frac {\cos ^3(c+d x) \cot (c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {x}{2 a}-\frac {\text {arctanh}(\cos (c+d x))}{a d}+\frac {\cos (c+d x)}{a d}-\frac {\cos (c+d x) \sin (c+d x)}{2 a d} \]

[Out]

-1/2*x/a-arctanh(cos(d*x+c))/a/d+cos(d*x+c)/a/d-1/2*cos(d*x+c)*sin(d*x+c)/a/d

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2918, 2672, 327, 212, 2715, 8} \[ \int \frac {\cos ^3(c+d x) \cot (c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\text {arctanh}(\cos (c+d x))}{a d}+\frac {\cos (c+d x)}{a d}-\frac {\sin (c+d x) \cos (c+d x)}{2 a d}-\frac {x}{2 a} \]

[In]

Int[(Cos[c + d*x]^3*Cot[c + d*x])/(a + a*Sin[c + d*x]),x]

[Out]

-1/2*x/a - ArcTanh[Cos[c + d*x]]/(a*d) + Cos[c + d*x]/(a*d) - (Cos[c + d*x]*Sin[c + d*x])/(2*a*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2672

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> With[{ff = FreeFactors[S
in[e + f*x], x]}, Dist[ff/f, Subst[Int[(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, a*(Sin[e + f*x]/ff)
], x]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]

Rule 2715

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Sin[c + d*x])^(n - 1)/(d*n))
, x] + Dist[b^2*((n - 1)/n), Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integ
erQ[2*n]

Rule 2918

Int[((cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.))/((a_) + (b_.)*sin[(e_.) + (f_
.)*(x_)]), x_Symbol] :> Dist[g^2/a, Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^n, x], x] - Dist[g^2/(b*d),
Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2
 - b^2, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {\int \cos ^2(c+d x) \, dx}{a}+\frac {\int \cos (c+d x) \cot (c+d x) \, dx}{a} \\ & = -\frac {\cos (c+d x) \sin (c+d x)}{2 a d}-\frac {\int 1 \, dx}{2 a}-\frac {\text {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\cos (c+d x)\right )}{a d} \\ & = -\frac {x}{2 a}+\frac {\cos (c+d x)}{a d}-\frac {\cos (c+d x) \sin (c+d x)}{2 a d}-\frac {\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{a d} \\ & = -\frac {x}{2 a}-\frac {\text {arctanh}(\cos (c+d x))}{a d}+\frac {\cos (c+d x)}{a d}-\frac {\cos (c+d x) \sin (c+d x)}{2 a d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.65 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.02 \[ \int \frac {\cos ^3(c+d x) \cot (c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {-4 \cos (c+d x)+2 \left (c+d x+2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-2 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+\sin (2 (c+d x))}{4 a d} \]

[In]

Integrate[(Cos[c + d*x]^3*Cot[c + d*x])/(a + a*Sin[c + d*x]),x]

[Out]

-1/4*(-4*Cos[c + d*x] + 2*(c + d*x + 2*Log[Cos[(c + d*x)/2]] - 2*Log[Sin[(c + d*x)/2]]) + Sin[2*(c + d*x)])/(a
*d)

Maple [A] (verified)

Time = 0.22 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.78

method result size
parallelrisch \(\frac {-2 d x +4 \cos \left (d x +c \right )+4 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\sin \left (2 d x +2 c \right )-4}{4 d a}\) \(46\)
derivativedivides \(\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {2 \left (-\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}-\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2}-1\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) \(87\)
default \(\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {2 \left (-\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}-\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2}-1\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) \(87\)
risch \(-\frac {x}{2 a}+\frac {{\mathrm e}^{i \left (d x +c \right )}}{2 a d}+\frac {{\mathrm e}^{-i \left (d x +c \right )}}{2 a d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d a}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d a}-\frac {\sin \left (2 d x +2 c \right )}{4 d a}\) \(98\)
norman \(\frac {\frac {1}{a d}-\frac {\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )}{d a}-\frac {\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )}{d a}+\frac {\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )}{d a}-\frac {x}{2 a}-\frac {x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a}-\frac {3 x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}-\frac {3 x \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}-\frac {3 x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}-\frac {3 x \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}-\frac {x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}-\frac {x \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}\) \(235\)

[In]

int(cos(d*x+c)^4*csc(d*x+c)/(a+a*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/4*(-2*d*x+4*cos(d*x+c)+4*ln(tan(1/2*d*x+1/2*c))-sin(2*d*x+2*c)-4)/d/a

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.97 \[ \int \frac {\cos ^3(c+d x) \cot (c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {d x + \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, \cos \left (d x + c\right ) + \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, a d} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)/(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

-1/2*(d*x + cos(d*x + c)*sin(d*x + c) - 2*cos(d*x + c) + log(1/2*cos(d*x + c) + 1/2) - log(-1/2*cos(d*x + c) +
 1/2))/(a*d)

Sympy [F]

\[ \int \frac {\cos ^3(c+d x) \cot (c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\int \frac {\cos ^{4}{\left (c + d x \right )} \csc {\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \]

[In]

integrate(cos(d*x+c)**4*csc(d*x+c)/(a+a*sin(d*x+c)),x)

[Out]

Integral(cos(c + d*x)**4*csc(c + d*x)/(sin(c + d*x) + 1), x)/a

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 156 vs. \(2 (55) = 110\).

Time = 0.31 (sec) , antiderivative size = 156, normalized size of antiderivative = 2.64 \[ \int \frac {\cos ^3(c+d x) \cot (c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\frac {\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {2 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} - 2}{a + \frac {2 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} + \frac {\arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a}}{d} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)/(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

-((sin(d*x + c)/(cos(d*x + c) + 1) - 2*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 - sin(d*x + c)^3/(cos(d*x + c) + 1)
^3 - 2)/(a + 2*a*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + a*sin(d*x + c)^4/(cos(d*x + c) + 1)^4) + arctan(sin(d*x
 + c)/(cos(d*x + c) + 1))/a - log(sin(d*x + c)/(cos(d*x + c) + 1))/a)/d

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.49 \[ \int \frac {\cos ^3(c+d x) \cot (c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\frac {d x + c}{a} - \frac {2 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a} - \frac {2 \, {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2} a}}{2 \, d} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)/(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

-1/2*((d*x + c)/a - 2*log(abs(tan(1/2*d*x + 1/2*c)))/a - 2*(tan(1/2*d*x + 1/2*c)^3 + 2*tan(1/2*d*x + 1/2*c)^2
- tan(1/2*d*x + 1/2*c) + 2)/((tan(1/2*d*x + 1/2*c)^2 + 1)^2*a))/d

Mupad [B] (verification not implemented)

Time = 9.87 (sec) , antiderivative size = 136, normalized size of antiderivative = 2.31 \[ \int \frac {\cos ^3(c+d x) \cot (c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a\,d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+2}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a\right )}+\frac {\mathrm {atan}\left (\frac {1}{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+2}-\frac {2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+2}\right )}{a\,d} \]

[In]

int(cos(c + d*x)^4/(sin(c + d*x)*(a + a*sin(c + d*x))),x)

[Out]

log(tan(c/2 + (d*x)/2))/(a*d) + (2*tan(c/2 + (d*x)/2)^2 - tan(c/2 + (d*x)/2) + tan(c/2 + (d*x)/2)^3 + 2)/(d*(a
 + 2*a*tan(c/2 + (d*x)/2)^2 + a*tan(c/2 + (d*x)/2)^4)) + atan(1/(tan(c/2 + (d*x)/2) + 2) - (2*tan(c/2 + (d*x)/
2))/(tan(c/2 + (d*x)/2) + 2))/(a*d)